package net.orange.framework.dao;

import java.util.Collection;

import net.orange.architecture.db.ICacheDao;
import net.orange.framework.model.Commoninfo;

/**
 * The interface of common info object database delegate, to retrieve , save ,
 * remove or process other operation in common info table.
 */
public interface ICommoninfoDao extends ICacheDao {
	/**
	 * Find the commoninfo by the key (code & type). It will search in the cache
	 * first. If it cann't find in the cache, it will load from database.
	 * 
	 * @param key
	 *            The resource type
	 * @param code
	 *            The resource code
	 * @return The target resource.
	 * @throws Exception
	 */
	public Commoninfo findByKey(String type, String code) throws Exception;

	/**
	 * Find the commoninfo collection by the key (code & type). It will search
	 * in the cache first. If it cann't find in the cache, it will load from
	 * database.
	 * 
	 * @param type
	 *            The type.
	 * @return The commoninfo collection
	 * @throws Exception
	 */
	public Collection listByKey(String type) throws Exception;
}